<% flash.each do |message_type, message| %>
<div class="danger"><%= message %></div>
<% end %>
<div id=product_list>  
  
<h1>Listing products</h1>  
  
<table>  
  
  
<% @products.each do |product| %>  
  
  <tr class="<%= cycle('list_line_odd', 'list_line_even') %>">  
  
    <td>  
  
    <%#<%= image_tag(product.image_url, :class => 'list_image') %>  
    <div class="list_image">
  <%= image_tag( product.picture.url,:size => "140x80" ) if product.picture? %>
</div>
    </td>  
  
    <td class="list_description">  
  
    <dl>  
  
    <dt><%= product.title %></dt>  
  
    <dd><%= truncate(strip_tags(product.description), :length => 80) %></dd>  
  
    </dl>  
  
    </td>  
  
    <td class="list_actions">  
  
    <%= link_to 'Show', product %><br/>  
  <%if  is_admin? %>
    <%= link_to 'Edit', edit_product_path(product) %><br/>  
  
    <%= link_to 'Destroy', product, :confirm => 'Are you sure?', :method => :delete %></td>  
  <% end %>
  </tr>  
  
<% end %>  
  
   
</div>  
  
</table>  
<br />  
<%if  is_admin? %>
<%= link_to 'New Product', new_product_path %>  
<% end %>